class RequestMethodError(Exception):
    def __str__(self):
        return 'Http请求方法错误！'


class NullRequest(Exception):
    def __str__(self):
        return '请求内容为空！'


class ParamsInvalid(Exception):
    def __init__(self, msg=''):
        self._msg = msg

    def __str__(self):
        return '参数 {} 无效！'.format(self._msg)


class SessionIsInvalid(Exception):
    def __init__(self, uuid=''):
        self._id = uuid

    def __str__(self):
        return 'Session {} 无效！'.format(self._id)


class NoSessionIDProvide(Exception):
    def __init__(self):
        pass

    def __str__(self):
        return '未提供Session UUID！'


class NoCookiesProvide(Exception):
    def __str__(self):
        return '未提供Cookies信息！'


class SessionNotExist(Exception):
    def __init__(self, uuid=''):
        self._uuid = uuid

    def __str__(self):
        return 'Session {} 不存在！'.format(self._uuid)


class UserNotExist(Exception):
    def __init__(self, user_id=''):
        self._id = user_id

    def __str__(self):
        return '用户 id={} 不存在！'.format(self._id)


class UserNameExisted(Exception):
    def __init__(self, username=''):
        self._username = username

    def __str__(self):
        return '用户名 {} 已存在'.format(self._username)


class ItemNotExist(Exception):
    def __init__(self, item):
        self._item = item

    def __str__(self):
        return '{} 不存在！'.format(self._item)


class LoginOutOfDate(Exception):
    def __init__(self, uuid=''):
        self._uuid = uuid

    def __str__(self):
        return '登录 {} 已过期！'.format(self._uuid)


class SessionOutOfDate(Exception):
    def __init__(self, uuid=''):
        self._uuid = uuid

    def __str__(self):
        return 'Session {} 已过期！'.format(self._uuid)
